package com.zdkj.subway.check.service;

import com.alibaba.fastjson.JSONObject;
import com.zdkj.subway.check.entity.SwAuStDiffNotice;
import com.zdkj.subway.check.enums.ResultDetailMsg;
import com.zdkj.subway.check.mapper.SwAuStDiffNoticeMapper;
import com.zdkj.subway.check.result.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
/**
 * 线网层级确认-车站票款差异-车站票款差异确认通知
 * 车站票款差异通知 SW_AU_ST_DIFF_NOTICE
 */
@Service
public class SwAuStDiffNoticeService {

    @Resource
    private SwAuStDiffNoticeMapper swAuStDiffNoticeMapper;


    /**
     * 车站票款差异通知 单独查询
     * @param jsonObject
     * @return
     */
    public Result getSwAuConductorNotice(JSONObject jsonObject) {
        Integer id = jsonObject.getInteger("id");
        SwAuStDiffNotice swAuStDiffNotice = swAuStDiffNoticeMapper.selectByPrimaryKey(id);
        JSONObject resultJson = new JSONObject();
        resultJson.put("obj",swAuStDiffNotice);
        return new Result(ResultDetailMsg.OK,resultJson);
    }

    public Result updateSwAuConductorNotice(JSONObject jsonObject) {
        SwAuStDiffNotice swAuStDiffNotice =
                JSONObject.parseObject(jsonObject.toJSONString(), SwAuStDiffNotice.class);
        int i = swAuStDiffNoticeMapper.updateByPrimaryKeySelective(swAuStDiffNotice);
        return new Result(ResultDetailMsg.OK);
    }
}
